using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._GeostatisticalAnalystTools._Simulation
{
    /// <summary>
    /// <para>Extract Values To Table</para>
    /// <para>Extracts cell values from a set of rasters to a table, based on a point or polygon feature class.</para>
    /// <para>基于点或面要素类将一组栅格中的像元值提取到表中。</para>
    /// </summary>    
    [DisplayName("Extract Values To Table")]
    public class ExtractValuesToTable : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public ExtractValuesToTable()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_features">
        /// <para>Input features</para>
        /// <para>The points or polygon features to be created.</para>
        /// <para>要创建的点或面要素。</para>
        /// </param>
        /// <param name="_in_rasters">
        /// <para>Input rasters</para>
        /// <para>The rasters must all have the same extent, coordinate system, and cell size.</para>
        /// <para>栅格必须都具有相同的范围、坐标系和像元大小。</para>
        /// </param>
        /// <param name="_out_table">
        /// <para>Output table</para>
        /// <para>The output table contains a record for each point and each raster that has data. If polygon features are input, they are converted to points that coincide with the raster cell centers.</para>
        /// <para>输出表包含每个点和每个具有数据的栅格的记录。如果输入了面要素，则这些要素将转换为与栅格像元中心重合的点。</para>
        /// </param>
        public ExtractValuesToTable(object _in_features, List<object> _in_rasters, object _out_table)
        {
            this._in_features = _in_features;
            this._in_rasters = _in_rasters;
            this._out_table = _out_table;
        }
        public override string ToolboxName => "Geostatistical Analyst Tools";

        public override string ToolName => "Extract Values To Table";

        public override string CallName => "ga.ExtractValuesToTable";

        public override List<string> AcceptEnvironments => ["extent", "scratchWorkspace", "workspace"];

        public override object[] ParameterInfo => [_in_features, _in_rasters, _out_table, _out_raster_names_table, _add_warning_field.GetGPValue()];

        /// <summary>
        /// <para>Input features</para>
        /// <para>The points or polygon features to be created.</para>
        /// <para>要创建的点或面要素。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_features { get; set; }


        /// <summary>
        /// <para>Input rasters</para>
        /// <para>The rasters must all have the same extent, coordinate system, and cell size.</para>
        /// <para>栅格必须都具有相同的范围、坐标系和像元大小。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input rasters")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public List<object> _in_rasters { get; set; }


        /// <summary>
        /// <para>Output table</para>
        /// <para>The output table contains a record for each point and each raster that has data. If polygon features are input, they are converted to points that coincide with the raster cell centers.</para>
        /// <para>输出表包含每个点和每个具有数据的栅格的记录。如果输入了面要素，则这些要素将转换为与栅格像元中心重合的点。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output table")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_table { get; set; }


        /// <summary>
        /// <para>Output raster names table</para>
        /// <para>Saves the names of the Input rasters to disc.</para>
        /// <para>将输入栅格的名称保存到光盘。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output raster names table")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _out_raster_names_table { get; set; } = null;


        /// <summary>
        /// <para>Add warnings to output table</para>
        /// <para><xdoc>
        ///   <para>Records if input features are partially or completely covered by the Input rasters.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—Warning field is added to the output table and populated with a P when a feature is partially covered by raster values.</bullet_item><para/>
        ///     <bullet_item>Unchecked—Warning field is not added to the output table.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>记录输入要素是否部分或全部被输入栅格覆盖。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 当要素部分被栅格值覆盖时，警告字段将添加到输出表中并使用 P 进行填充。</bullet_item><para/>
        ///     <bullet_item>未选中 - 警告字段不添加到输出表中。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Add warnings to output table")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _add_warning_field_value _add_warning_field { get; set; } = _add_warning_field_value._true;

        public enum _add_warning_field_value
        {
            /// <summary>
            /// <para>ADD_WARNING_FIELD</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("ADD_WARNING_FIELD")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>DO_NOT_ADD_WARNING_FIELD</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("DO_NOT_ADD_WARNING_FIELD")]
            [GPEnumValue("false")]
            _false,

        }

        public ExtractValuesToTable SetEnv(object extent = null, object scratchWorkspace = null, object workspace = null)
        {
            base.SetEnv(extent: extent, scratchWorkspace: scratchWorkspace, workspace: workspace);
            return this;
        }

    }

}